package com.bawei.exam57.adpater

import com.bawei.exam57.R
import com.bawei.exam57.room.JfEntity
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class JfAdpater:BaseQuickAdapter<JfEntity,BaseViewHolder>(R.layout.item_jf) {
    override fun convert(holder: BaseViewHolder, item: JfEntity) {
//        true为支出，false为收入
        if (item.out_or_in){
            holder.setText(R.id.tv_jf_t,"兑换商品")
            holder.setText(R.id.tv_jf_num,"-"+item.jfupdata)
        }else{
            holder.setText(R.id.tv_jf_t,"赚积分")
            holder.setText(R.id.tv_jf_num,"+"+item.jfupdata)
        }
        holder.setText(R.id.tv_jf_time,item.time)
    }
}